package io.github.talelin.latticy.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.talelin.autoconfigure.validator.Enum;
import io.github.talelin.latticy.common.enumeration.OnlineOrNotEnum;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 活动的入参信息
 *
 * @author YiHua
 * @date 2021/11/30 3:12 下午
 */
@Data
public class ActivityBO{

       // 活动标题
       @NotBlank
       @Length(min = 1, max = 60)
       private String title;

       // 活动名称
       @NotBlank
       @Length(min = 1, max = 20)
       private String name;

       // 活动描述
       @Length(min = 1, max = 255)
       private String description;

       // 活动开始的时间
       @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTC")
       @NotNull
       private Date startTime;

       // 活动结束的时间
       @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTC")
       @NotNull
       private Date endTime;

       // 活动备注描述,例如'领券中心'
       @Length(min = 1, max = 60)
       private String remark;

       // 是否上线
       @Enum(target = OnlineOrNotEnum.class, allowNull = false)
       private Integer online;

       // 活动入口图片
       @NotBlank
       @Length(min = 1, max = 255)
       private String entranceImg;

       // 活动详情页顶部图片
       @NotBlank
       @Length(min = 1, max = 255)
       private String internalTopImg;

       // 关联的优惠券id
       private List<@Min(1) Integer> couponIds;
}